import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import  Layout  from '../views/layout'

const routes = [
  {
    path: '/',
    name: 'index',
    redirect:'/login',
    component: Layout,
    children:[
      {
        path: 'userList',
        name: 'userList',
        component: () => import('../views/userList.vue')
      },
      {
        path: 'bookList',
        name: 'bookList',
        component: () => import('../views/bookList.vue')
      }
    ]
  },
  {
    path:'/login',
    component:() => import('../views/login.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
